import math
import _00GraphFuc as gf
import _00GraphTreeFuc as gt

#12.4.1构造霍夫曼树
W=[[0.08,'a'],[0.10,'b'],[0.12,'c'],[0.15,'d'],[0.20,'e'],[0.35,'f']]
r=0
for[w,u] in W:
    r=r-w*math.log2(w)
print(r)